<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
{% include 'planning.css' with context %}
<body>

{% if pageData["view"] =="month" %}

<div class="workinMonth">{{ pageData["monthName"][pageData["workinMonth"]]|upper }} - {{ pageData["workinYearc"] }}</div>
<table class="monthTable">
<tr>
{% for day in pageData["dayName"] %}
    <th  id="monthTd">
    <b>{{day}}</b></th>
{% endfor %}
</tr>

{% for cal in pageData["cale"] %}
<tr>
    {% for c in cal %}

{% if c.day== pageData["workinDay"] %}
<td ondblclick="window.location='program:/newPromemoria={{c}}'" >
<span><b>[</b>{{c.day}}<b>]</b></span>

{% for a in pageData["eventipromes_ins"] %}
    {% if c.toordinal() == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/promemoriaId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}

{% for a in pageData["eventipromes_scad"] %}
    {% if c.toordinal() == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/promemoriaId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}

{% for a in pageData["eventipreves"] %}
    {% if c.toordinal() == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/testataDocumentoId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}

{% for a in pageData["eventiprevesAT"] %}
    {% if c.toordinal() == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/testataDocumentoId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}

{% for a in pageData["eventiordes"] %}
    {% if c.toordinal() == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/testataDocumentoId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}

{% for a in pageData["eventiordesAT"] %}
    {% if c.toordinal() == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/testataDocumentoId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}


{% else %}
<td ondblclick="window.location='program:/newPromemoria={{c}}'"  >
{{c.day}}

{% for a in pageData["eventipromes_ins"] %}
    {% if c.toordinal() == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/promemoriaId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}

{% for a in pageData["eventipromes_scad"] %}
    {% if c.toordinal() == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/promemoriaId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}

{% for a in pageData["eventipreves"] %}
    {% if c.toordinal() == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/testataDocumentoId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}

{% for a in pageData["eventiprevesAT"] %}
    {% if c.toordinal() == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/testataDocumentoId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}

{% for a in pageData["eventiordes"] %}
    {% if c.toordinal() == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/testataDocumentoId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}

{% for a in pageData["eventiordesAT"] %}
    {% if c.toordinal() == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/testataDocumentoId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}
{% endif %}
</td>
{% endfor %}
{% endfor %}
</tr></table>

{% elif pageData["view"] == "week" %}
            {{ pageData["dayName"][pageData["weekDay"]]|upper }} - {{ pageData["workinDay"]}}/{{ pageData["workinMonth"]}}/{{ pageData["workinYearc"]}}
<table class="weekTable" cellspacing="0" cellpadding="5">
<tr>

{% for c in pageData["onlyWeek"] %}

{% if pageData["dayName"][pageData["weekDay"]] == c[3]|string %}
<th>
    <b>{{c[3]|upper}} {{c[1]}}</b>
</th>
{% else %}
<th >
{{c[3]}} {{c[1]}}</th>
{% endif %}
{% endfor %}
</tr>

    <tr >
{% for c in pageData["onlyWeek"] %}
<td ondblclick="window.location='program:/newPromemoria={{c}}'">

{% for a in pageData["eventipromes_ins"] %}
    {% if c[0] == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/promemoriaId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}

{% for a in pageData["eventipromes_scad"] %}
    {% if c[0] == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/promemoriaId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}

{% for a in pageData["eventipreves"] %}
    {% if c[0] == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/testataDocumentoId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}

{% for a in pageData["eventiprevesAT"] %}
    {% if c[0] == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/testataDocumentoId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}

{% for a in pageData["eventiordes"] %}
    {% if c[0] == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/testataDocumentoId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}

{% for a in pageData["eventiordesAT"] %}
    {% if c[0] == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/testataDocumentoId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}
</td>
{% endfor %}
    </tr>
</table>


{% elif pageData["view"] == "day" %}
<TABLE class="dayTable" CELLPADDING=4 CELLSPACING=0>
    <TR>
        <TH >
            <P class="workinMonth">
            {{ pageData["dayName"][pageData["weekDay"]]|upper }} - {{ pageData["workinDay"]}}/{{ pageData["workinMonth"]}}/{{ pageData["workinYearc"]}}
            </P>
        </TH>
    <tr>
{% for c in pageData["onlyWeek"] %}
{% if pageData["dayName"][pageData["weekDay"]] == c[3] %}
<td ondblclick="window.location='program:/newPromemoria={{c}}'">
{% for a in pageData["eventipromes_ins"] %}
    {% if c[0] == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/promemoriaId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}

{% for a in pageData["eventipromes_scad"] %}
    {% if c[0] == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/promemoriaId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}

{% for a in pageData["eventipreves"] %}
    {% if c[0] == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/testataDocumentoId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}

{% for a in pageData["eventiprevesAT"] %}
    {% if c[0] == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/testataDocumentoId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}

{% for a in pageData["eventiordes"] %}
    {% if c[0] == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/testataDocumentoId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}

{% for a in pageData["eventiordesAT"] %}
    {% if c[0] == a[0] %}
    <div style='background:{{a[1]["colore"]}};' ><a href='program:/testataDocumentoId={{a[1]["id"]}}'><p>{{a[1]["short"]}}</p></a></div>
    {% endif %}
{% endfor %}
</td>
{% endif %}
{% endfor %}
    </tr>

</TABLE>
{% endif %}
</body>
</html>
